<%@page import="java.util.Iterator"%>
<%@page import="user.User"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改个人信息</title>
<style type="text/css">
body {
	font-family: 楷体;
	font-size: 20px;
	background-image: url("../images/1.png");
	background-size: cover;
}

h1 {
	float: left;
	padding-left: 10%;
	color: #fff;
	font-size: 50px;
}

table {
	left: 55%;
	padding: 6% 4% 6% 3%;
	margin-right: auto;
	margin-left: auto;
	margin-top: 0%;
	color: #fff;
	border-collapse: separate;
	border-spacing: 10px 20px;
}

.text {
	position: relative;
}

.form-control {
	width: 200px;
	padding: 7px 0px;
	color: #fff;
	border: none;
	border-bottom: 1px solid #fff;
	outline: none;
	background: transparent;
	border: none;
}

.form-control:focus {
	border-color: rgba(59, 137, 245, 0.5);
	outline: 0;
}

.box {
	background: rgba(0, 0, 1, .7);
	box-shadow: 0 15px 25px rgba(0, 0, 0, .5);
	border-radius: 10px;
}

.submit {
	width: 80%;
	height: 50px;
	background-color: #3B89F5;
	border: none;
	font-size: 18px;
	color: #fff;
	border-radius: 8px;
	-webkit-transition-duration: 0.4s;
	transition-duration: 0.4s;
}

.submit:HOVER {
	background-color: #0C6CED;
	color: #fff;
	cursor: pointer;
}

.Hyperlink {
	text-decoration: none;
}

.a::HOVER {
	position: absolute;
	left: 15px;
	top: 20px;
	padding: 50px;
	background-color: #0095ff;
	border-radius: 5px;
	color: #fff;
	content: attr(title);
	z-index: 2;
	width: 120px;
}

.b::HOVER {
	position: absolute;
	left: 15px;
	top: 5px;
	padding: 5px;
	background-color: #0095ff;
	border-radius: 5px;
	color: #fff;
	content: attr(title);
	z-index: 2;
	width: 120px;
}

textarea {
	resize: none;
}
</style>
</head>
<body>
	<%
		ArrayList<User> list = (ArrayList<User>) session.getAttribute("list");
		Iterator<User> iterator = list.iterator();
		while (iterator.hasNext()) {
			User user = iterator.next();
			String sex_1 = user.getSex();
			int sex;
			if (sex_1.equals("0")) {
				sex = 0;
			} else {
				sex = 1;
			}
			//System.out.println(user.getFavourite().trim());
	%>
	<form action="../User_Modify?uid=<%=user.getUid() %>" method="post">
	<table style="background-color: Light purple">
		<tr align="center">
			<td class="text" align="center">用户名:</td>
			<td colspan="3" class="text" align="center"><input class="form-control" type="text"
				name="uname" readonly="readonly" value="<%=user.getUname()%>">
			</td>
		</tr>
		<tr>
			<td class="text" align="center">性别:</td>
			<%
				if (sex == 0) {
			%>
			<td><input type="radio" name="sex" value="0" checked>男 <input
				type="radio" name="sex" value="1" />女</td>
			<%
				} else {
			%>
			<td><input type="radio" name="sex" value="0">男 <input
				type="radio" name="sex" value="1" checked>女</td>
			<%
				}
			%>
		</tr>
		<tr>
			<td class="text" align="center">职业:</td>
			<td><select name="profession">
			<%if("学生".equals(user.getProfession().trim())) {%>
			<option value="学生" selected>学生</option>
			<%}%>
				<%if("学生".equals(user.getProfession().trim())) {%>
			<option value="教师" selected>教师</option>
			<%}%>	
					
			</select></td>
		</tr>
		<tr >
			<td class="text" align="center">个人爱好:</td>
			<%
				if (user.getFavourite().trim() == null) {
			%>
			<td colspan="3" class="text" align="center"><input type="checkbox" name="favourite"
				value="电脑网络">电脑网络&nbsp;&nbsp; <input type="checkbox"
				name="favourite" value="影视娱乐">影视娱乐&nbsp;&nbsp; <input
				type="checkbox" name="favourite" value="棋牌娱乐">棋牌娱乐&nbsp;&nbsp;
			</td>
			<%
				}
			%>
			<%
				if ("电脑网络".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center">
			    <input type="checkbox" name="favourite" value="电脑网络" checked>电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" >影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" >棋牌娱乐&nbsp;&nbsp;
				<%
					}
				%></td>
			<%
				if ("影视娱乐".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center">
			   <input type="checkbox" name="favourite" value="电脑网络" >电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" checked>影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" >棋牌娱乐&nbsp;&nbsp;
				<%
					}
				%></td>
			<%
				if ("棋牌娱乐".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center">
			    <input type="checkbox" name="favourite" value="电脑网络" >电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" >影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" checked>棋牌娱乐&nbsp;&nbsp;
				<%
					}
				%></td>
			<%
				if ("电脑网络影视娱乐".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center">
			   <input type="checkbox" name="favourite" value="电脑网络" checked>电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" checked>影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" >棋牌娱乐&nbsp;&nbsp;
			</td>
			<%
				}
			%>
			<%
				if ("电脑网络棋牌娱乐".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center">
			    <input type="checkbox" name="favourite" value="电脑网络" checked>电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" >影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" checked>棋牌娱乐&nbsp;&nbsp;</td>
			<%
				}
			%>
			<%
				if ("影视娱乐棋牌娱乐".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center">
			    <input type="checkbox" name="favourite" value="电脑网络" >电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" checked>影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" checked>棋牌娱乐&nbsp;&nbsp;
		        </td>
			<%
				}
			%>
			<%
				if ("电脑网络影视娱乐棋牌娱乐".equals(user.getFavourite().trim())) {
			%>
			<td class="text" align="center"> 
			    <input type="checkbox" name="favourite" value="电脑网络"  checked>电脑网络&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="影视娱乐" checked>影视娱乐&nbsp;&nbsp;
		        <input type="checkbox" name="favourite" value="棋牌娱乐" checked>棋牌娱乐&nbsp;&nbsp;</td>
			<%
				}
			%>
		</tr>
		<tr>
			<td>个人说明:</td>
			<td colspan="3"><textarea name="note" rows="5" cols="40"><%=user.getNote()%></textarea></td>
		</tr>
		<tr>
			<td colspan="4" style="background-color: transparent;" align="center">
			   <input class="sr" type="submit" value="修改">
			   <input class="sr" type="reset">
			</td>
		</tr>
	</table>
	</form>
	<%
		}
	%>
</body>
</html>